﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AIOptimization.Algorithms;
using AIOptimization.Algorithms.Repositories;

namespace AIOptimization
{
    public class PSOTest : ParticleSwarmOptimization
    {
        public PSOTest()
        {
            SetParameter(10, 2, -100, 100, 1000, 0.729, 1.49445, 1.49445);
            List<AIOptimization.Algorithms.Repositories.Particle> results = Execute();
            foreach (var result in results)
            {
                Console.WriteLine(result.ToString());
            }
        }

        public override double ObjectiveFunction(double[] x)
        {
            return 3.0 + (x[0] * x[0]) + (x[1] * x[1]);
        }
    }
}
